#!/system/bin/sh

echo "# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system"
a=`mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system`
echo "$a"

echo "# cat /sdcard/recovery.img > /system/recovery.img"
c=`cat /sdcard/recovery.img > /system/recovery.img`
echo "$c"

echo "# flash_image recovery /system/recovery.img"
d=`flash_image recovery /system/recovery.img`
echo "$d"


case $a in 
  "*denied*")
echo "mount failed"
exit 0
;; 
esac

case $c in 
  "*denied*")
echo "cat recovery failed"
exit 0
;; 
esac

case $d in 
  "*denied*")
echo "flash recovery failed"
exit 0
;; 
esac



echo "Success"
exit 0
